import StyledComponentsRegistry from "@/utils/AntdRegistry";
import React from "react";
import { ToastContainer } from "react-toastify";
import Wow from "@/components/wow";
export { metadata, viewport } from "@/metadata";
import { ConfigProvider } from "antd";
import zhCN from "antd/locale/zh_CN";
import "dayjs/locale/en";
import "@/globals.css";
import theme from "@/config/themeConfig";
import { Noto_Sans_SC } from "next/font/google";
import { Slide } from "react-toastify";

const NotoSansSC = Noto_Sans_SC({
  weight: ["200", "300", "400", "500", "600", "700", "900"],
  preload: true,
  subsets: ["latin"],
  display: "swap",
});

const RootLayout = async ({ children }: React.PropsWithChildren) => {
  return (
    <html lang="zh-CN" className={NotoSansSC.className}>
      <Wow />
      <body className="w-full !overflow-x-hidden">
        <StyledComponentsRegistry>
          <ConfigProvider locale={zhCN} theme={theme}>
            {children}
          </ConfigProvider>
          <ToastContainer
            pauseOnHover={true}
            pauseOnFocusLoss={false}
            position="top-center"
            hideProgressBar={true}
            theme="colored"
            draggablePercent={60}
            autoClose={3000}
            transition={Slide}
            className="top-5"
          />
        </StyledComponentsRegistry>
      </body>
    </html>
  );
};

export default RootLayout;
